//1、引入http模块
const http = require('http')
//2、创建服务对象
const server = http.createServer(function(request, response) {
  console.log(request)
  console.log(response)
  response.writeHeader(200, { 'Content-type': 'text/plain' })
  response.end('hello Nodejs')
})
//3、启动服务监听请求
server.listen(8000, '127.0.0.1', function() {
  console.log('Server is running on 8000 ')
})